using System;


namespace EHSubmit.Model
{
    /// <summary>
    ///   用户对象
    /// </summary>
    public class User
    {
        private string _id;                        //User表的标识属性
        private string _pwd;                       //密码
        private string _name;                      //姓名
        private string _sex;                       //性别
        private DateTime _birthday;                //出生年月
        private string _photo;                     //照片路径
        private string _email;                     //电子邮件地址
        private string _phone;                     //电话
        private string _institute;                 //所属学院
        private string _department;                //所属专业
        private string _class;                     //所属班级号，如 0704
        private int _roleid;                       //角色ID
        private DateTime _createdtime;             //注册时间
        private int _logincount;                   //登陆次数
        private string _lastloginid;               //最近登陆时的Id
        private DateTime _lastlogintime;           //最近登陆时间


        /// <summary>
        /// 构造函数并初始化
        /// </summary>
        public User() 
        {
            this.Init();
        }

        public User(string _id, string _pwd,string _name, string _sex, DateTime _birthday, string _photo, string _email, string _phone, string _institute, string _department,string _class, int _roleid, DateTime _createdtime, int _logincount, string _lastloginid, DateTime _lastlogintime)
        {
            this._id = _id;
            this._pwd = _pwd;
            this._name = _name;
            this._sex = _sex;
            this._birthday = _birthday;
            this._photo = _photo;
            this._email = _email;
            this._phone = _phone;
            this._institute = _institute;
            this._department = _department;
            this._class = _class;
            this._roleid = _roleid;
            this._createdtime = _createdtime;
            this._logincount = _logincount;
            this._lastloginid = _lastloginid;
            this._lastlogintime = _lastlogintime;
        }

        /// <summary>
        /// 初始化
        /// </summary>
        /// <returns>初始化后返回true</returns>
        public bool Init()
        {
            this._id = string.Empty;                          //User表的标识属性
            this._pwd = string.Empty;                         //密码
            this._name = string.Empty;                        //姓名
            this._sex = string.Empty;                         //性别
            this._birthday = DateTime.Now;                    //出生年月
            this._photo = string.Empty;                       //照片路径
            this._email = string.Empty;                       //电子邮件地址
            this._phone = string.Empty;                       //电话
            this._institute = string.Empty;                   //所属学院
            this._department = string.Empty;                  //所属专业
            this._class = string.Empty;                       //所属班级号，如 0704
            this._roleid = -1;                                //角色ID
            this._createdtime = DateTime.Now;                 //注册时间
            this._logincount = 0;                             //登陆次数
            this._lastloginid = string.Empty;                 //最近登陆时的Id
            this._lastlogintime = DateTime.Now;               //最近登陆时间
            return true;
        }

        /// <summary>
        /// User表的标识属性
        /// </summary>
        public string ID 
        {
            get { return _id; }
            set { _id = value; }
        }

        /// <summary>
        /// 密码
        /// </summary>
        public string Pwd
        {
            get { return _pwd; }
            set { _pwd = value; }
        }

        /// <summary>
        /// 姓名
        /// </summary>
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        /// <summary>
        /// 姓名
        /// </summary>
        public string Sex
        {
            get { return _sex; }
            set { _sex = value; }
        }

        /// <summary>
        /// 出生年月
        /// </summary>
        public DateTime Birthday
        {
            get { return _birthday; }
            set { _birthday = value; }
        }

        /// <summary>
        /// 照片路径
        /// </summary>                                         
        public string Photo
        {
            get { return _photo; }
            set { _photo = value; }
        }

        /// <summary>
        /// 电子邮件地址
        /// </summary>
        public string Email
        {
            get { return _email; }
            set { _email = value; }
        }

        /// <summary>
        /// 电话
        /// </summary>
        public string Phone
        {
            get { return _phone; }
            set { _phone = value; }
        }

        /// <summary>
        /// 所属学院
        /// </summary>
        public string Institute
        {
            get { return _institute; }
            set { _institute = value; }
        }


        /// <summary>
        /// 所属专业
        /// </summary>
        public string Department
        {
            get { return _department; }
            set { _department = value; }
        }

        /// <summary>
        /// 所属班级号，如 0704
        /// </summary>
        public string Class
        {
            get { return _class; }
            set { _class = value; }
        }

        /// <summary>
        /// 角色ID
        /// </summary>
        public int RoleId
        {
            get { return _roleid; }
            set { _roleid = value; }
        }

        /// <summary>
        /// 注册时间
        /// </summary>
        public DateTime Createdtime
        {
            get { return _createdtime; }
            set { _createdtime = value; }
        }

        /// <summary>
        /// 登陆次数
        /// </summary>
        public int LoginCount
        {
            get { return _logincount; }
            set { _logincount = value; }
        }

        /// <summary>
        /// 最近登陆时的Id
        /// </summary>
        public string LastLoginId
        {
            get { return _lastloginid; }
            set { _lastloginid = value; }
        }

        /// <summary>
        /// 最近登陆时间
        /// </summary>
        public DateTime LastLoginTime
        {
            get { return _lastlogintime; }
            set { _lastlogintime = value; }
        }
    }
}
